package cz.muni.fi.xvano1.trinity.supplementary;

import net.sourceforge.stripes.action.ActionBeanContext;

/**
 * This is a simple enhancement to context available through basic ActionBeanContext
 * of web development framework Stripes. It allows accession to further data
 * that are needed throughout the application Trinity.
 *
 * @author Jan Vano
 */
public class ActionManagerBeanContext extends ActionBeanContext{
    /**
     * Method for querying which user is logged into application.
     * @return Logged user
     */
    public String getUser(){
        return (String) getRequest().getSession().getAttribute("user");
    }
    
    /**
     * Method for setting the information which user is logged.
     * @param user Logged user
     */
    public void setUser(String user){
        getRequest().getSession().setAttribute("user", user);
    }
    
}
